Understanding Control Flow by Peter A. Buhr

Understanding Control Flow by Peter A. Buhr

Author:Peter A. Buhr
Language: eng
Format: epub
Publisher: Springer International Publishing, Cham


7.6.3 Solution 2

One way to alleviate, but not eliminate, the starvation problem is to switch the priority of the readers and writers so a writer has the highest priority. This approach is reasonable because on most computer systems approximately 80 % of operations are reads and 20 % writes; therefore, there are many more readers than writers in a normal concurrent system. Thus, the probability of a continuous stream of writers is extremely rare because there are not that many writers in a system, making starvation of readers very unlikely (i.e., a probabilistic solution).

Switching priority between readers and writers in very simple. The second line of the entry protocol for a reader is changed to the following:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.